<%namespace name="admin_include" file="/admin/base/include.html" />
<%inherit file="/front/base/normalbase.html"/>
<%def name="script()">
${admin_include.validationEngine()}
</%def>

<%def name="center()">
<div class="row">
    <div class="span6">
    <div class="page-header">
        <h1>
            <a href="#sd">用户登陆</a>
        </h1>
    </div>
    %if request.session.peek_flash():
    <div class="alert alert-error">${request.session.pop_flash()[0]}</div>
    %endif
    <form id="loginform" class="form-horizontal" method="post" action="${request.url}">
        <fieldset>
            <div class="control-group">
                <label class="control-label">Email</label>
                <div class="controls">
                    <input type="text" class="input-xlarge validate[required, custom[email]]" name="email">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">密码</label>
                <div class="controls">
                    <input type="password" class="input-xlarge validate[required]" name="password">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">验证码</label>
                <div class="controls">
                    <input type="text" class="input-small validate[required]" name="captcha">
                    <p class="help-block"><img id="captcha" src="/captcha"/>&nbsp;<a id="changeCaptcha" href="#">换一个</a></p>
                </div>
            </div>
            <div class="form-actions">
                <button class="btn btn-primary" type="submit">登陆</button>
                <button class="btn">忘记密码</button>
            </div>
        </fieldset>
    </form>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $('#changeCaptcha').click(function(){
            $('#captcha').attr('src', '/captcha?' + Math.random()*1000);
        })
        $('#loginform').validationEngine();
    })
</script>
</%def>

